Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve type hints on File #111

Merged
merged 1 commit into from
Feb 12, 2024
Merged

Improve type hints on File #111

merged 1 commit into from
Feb 12, 2024

Conversation

Kludex
Copy link
Owner

@Kludex Kludex commented Feb 12, 2024

No description provided.

@@ -50,7 +50,7 @@ class FormParserConfig(TypedDict, total=False):
MAX_BODY_SIZE: float

class FileConfig(TypedDict, total=False):
UPLOAD_DIR: str | None
UPLOAD_DIR: str | bytes | None
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I need to think about this, but for now this is the most correct.

@@ -471,7 +471,7 @@ def flush_to_disk(self) -> None:
# Close the old file object.
old_fileobj.close()

def _get_disk_file(self):
def _get_disk_file(self) -> io.BufferedRandom | tempfile._TemporaryFileWrapper[bytes]: # type: ignore[reportPrivateUsage]
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The most correct for now...

@Kludex Kludex changed the title Keep improving type hints Improve type hints Feb 12, 2024
@Kludex Kludex changed the title Improve type hints Improve type hints on File Feb 12, 2024
@Kludex Kludex merged commit f4479c6 into master Feb 12, 2024
6 checks passed
@Kludex Kludex deleted the keep-improving-type-hints branch February 12, 2024 22:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant